// 节日诗词数据库
// 包含标题、作者、朝代、全文、注释、标签等信息

export const poemsDatabase = {
  // 春节相关诗词
  springFestival: [
    {
      id: 1,
      title: "元日",
      author: "王安石",
      dynasty: "宋",
      content: "爆竹声中一岁除，春风送暖入屠苏。千门万户曈曈日，总把新桃换旧符。",
      annotation: "这首诗描写了春节的热闹景象，爆竹声、春风、新桃符等元素展现了节日的喜庆氛围。",
      tags: ["春节", "新年", "喜庆", "爆竹", "春风"],
      festival: "春节"
    },
    {
      id: 2,
      title: "除夜",
      author: "高适",
      dynasty: "唐",
      content: "旅馆寒灯独不眠，客心何事转凄然。故乡今夜思千里，霜鬓明朝又一年。",
      annotation: "诗人在除夕夜思念故乡，感叹时光流逝，表达了对家乡的深深思念。",
      tags: ["春节", "思乡", "除夕", "时光", "故乡"],
      festival: "春节"
    },
    {
      id: 3,
      title: "新年作",
      author: "刘长卿",
      dynasty: "唐",
      content: "乡心新岁切，天畔独潸然。老至居人下，春归在客先。岭猿同旦暮，江柳共风烟。已似长沙傅，从今又几年。",
      annotation: "诗人在新年时思念故乡，感叹自己漂泊在外，表达了对家乡的思念之情。",
      tags: ["春节", "思乡", "新年", "漂泊", "思念"],
      festival: "春节"
    },
    {
      id: 4,
      title: "除夜雪",
      author: "陆游",
      dynasty: "宋",
      content: "北风吹雪四更初，嘉瑞天教及岁除。半盏屠苏犹未举，灯前小草写桃符。",
      annotation: "除夕夜下雪，诗人认为这是吉祥的预兆，在灯前写桃符迎接新年。",
      tags: ["春节", "除夕", "雪", "吉祥", "桃符"],
      festival: "春节"
    },
    {
      id: 5,
      title: "守岁",
      author: "苏轼",
      dynasty: "宋",
      content: "欲知垂尽岁，有似赴壑蛇。修鳞半已没，去意谁能遮。况欲系其尾，虽勤知奈何。儿童强不睡，相守夜欢哗。晨鸡且勿唱，更鼓畏添挝。坐久灯烬落，起看北斗斜。明年岂无年，心事恐蹉跎。努力尽今夕，少年犹可夸。",
      annotation: "诗人描写除夕守岁的情景，感叹时光流逝，勉励自己珍惜时间。",
      tags: ["春节", "守岁", "时光", "珍惜", "少年"],
      festival: "春节"
    },
    {
      id: 26,
      title: "田家元日",
      author: "孟浩然",
      dynasty: "唐",
      content: "昨夜斗回北，今朝岁起东。我年已强仕，无禄尚忧农。桑野就耕父，荷锄随牧童。田家占气候，共说此年丰。",
      annotation: "诗人在新年之际关心农事，表达了对丰收年景的期望。",
      tags: ["春节", "新年", "农事", "丰收", "田家"],
      festival: "春节"
    },
    {
      id: 27,
      title: "岁除夜会乐城张少府宅",
      author: "孟浩然",
      dynasty: "唐",
      content: "畴昔通家好，相知无间然。续明催画烛，守岁接长筵。旧曲梅花唱，新正柏酒传。客行随处乐，不见度年年。",
      annotation: "诗人在除夕夜与朋友聚会，表达了对友谊的珍惜和对新年的祝福。",
      tags: ["春节", "除夕", "友谊", "聚会", "祝福"],
      festival: "春节"
    },
    {
      id: 28,
      title: "卖痴呆词",
      author: "范成大",
      dynasty: "宋",
      content: "除夕更阑人不睡，厌禳钝滞迎新岁。小儿呼叫走长街，云有痴呆召人买。二物于人谁独无，就中吴侬仍有余。巷南巷北卖不得，相逢大笑相揶揄。栎翁块坐重帘下，独要买添令问价。儿云翁买不须钱，奉赠痴呆千百年。",
      annotation: "诗人以幽默的笔调描写了除夕夜的热闹景象，充满了节日的欢乐气氛。",
      tags: ["春节", "除夕", "热闹", "欢乐", "幽默"],
      festival: "春节"
    }
  ],

  // 中秋节相关诗词
  midAutumnFestival: [
    {
      id: 6,
      title: "水调歌头·明月几时有",
      author: "苏轼",
      dynasty: "宋",
      content: "明月几时有，把酒问青天。不知天上宫阙，今夕是何年。我欲乘风归去，又恐琼楼玉宇，高处不胜寒。起舞弄清影，何似在人间。转朱阁，低绮户，照无眠。不应有恨，何事长向别时圆？人有悲欢离合，月有阴晴圆缺，此事古难全。但愿人长久，千里共婵娟。",
      annotation: "这首词是中秋节的经典之作，表达了诗人对亲人的思念和对美好生活的向往。",
      tags: ["中秋", "月亮", "思念", "团圆", "美好"],
      festival: "中秋节"
    },
    {
      id: 7,
      title: "静夜思",
      author: "李白",
      dynasty: "唐",
      content: "床前明月光，疑是地上霜。举头望明月，低头思故乡。",
      annotation: "诗人在月夜思念故乡，以月光为媒介，表达了对家乡的深深思念。",
      tags: ["中秋", "月亮", "思乡", "月光", "故乡"],
      festival: "中秋节"
    },
    {
      id: 8,
      title: "望月怀远",
      author: "张九龄",
      dynasty: "唐",
      content: "海上生明月，天涯共此时。情人怨遥夜，竟夕起相思。灭烛怜光满，披衣觉露滋。不堪盈手赠，还寝梦佳期。",
      annotation: "诗人望着海上升起的明月，思念远方的亲人，表达了对团圆的渴望。",
      tags: ["中秋", "月亮", "思念", "团圆", "相思"],
      festival: "中秋节"
    },
    {
      id: 9,
      title: "月夜忆舍弟",
      author: "杜甫",
      dynasty: "唐",
      content: "戍鼓断人行，边秋一雁声。露从今夜白，月是故乡明。有弟皆分散，无家问死生。寄书长不达，况乃未休兵。",
      annotation: "诗人在月夜思念分散的兄弟，感叹战乱带来的分离之苦。",
      tags: ["中秋", "月亮", "思乡", "兄弟", "战乱"],
      festival: "中秋节"
    },
    {
      id: 10,
      title: "八月十五夜月",
      author: "杜甫",
      dynasty: "唐",
      content: "满月飞明镜，归心折大刀。转蓬行地远，攀桂仰天高。水路疑霜雪，林栖见羽毛。此时瞻白兔，直欲数秋毫。",
      annotation: "诗人在中秋夜望着满月，思念故乡，表达了对团圆的渴望。",
      tags: ["中秋", "月亮", "思乡", "团圆", "满月"],
      festival: "中秋节"
    },
    {
      id: 29,
      title: "中秋月",
      author: "晏殊",
      dynasty: "宋",
      content: "十轮霜影转庭梧，此夕羁人独向隅。未必素娥无怅恨，玉蟾清冷桂花孤。",
      annotation: "诗人在中秋夜感叹孤独，连嫦娥也有怅恨，表达了对团圆的渴望。",
      tags: ["中秋", "月亮", "孤独", "嫦娥", "桂花"],
      festival: "中秋节"
    },
    {
      id: 30,
      title: "中秋登楼望月",
      author: "米芾",
      dynasty: "宋",
      content: "目穷淮海满如银，万道虹光育蚌珍。天上若无修月户，桂枝撑损向西轮。",
      annotation: "诗人登楼望月，以奇特的想象描绘月亮的美丽，充满了浪漫色彩。",
      tags: ["中秋", "月亮", "登楼", "想象", "浪漫"],
      festival: "中秋节"
    },
    {
      id: 31,
      title: "十五夜望月寄杜郎中",
      author: "王建",
      dynasty: "唐",
      content: "中庭地白树栖鸦，冷露无声湿桂花。今夜月明人尽望，不知秋思落谁家。",
      annotation: "诗人在中秋夜望月，思考着家家户户都在望月思人的情景。",
      tags: ["中秋", "月亮", "思念", "秋思", "家家户户"],
      festival: "中秋节"
    },
    {
      id: 32,
      title: "嫦娥",
      author: "李商隐",
      dynasty: "唐",
      content: "云母屏风烛影深，长河渐落晓星沉。嫦娥应悔偷灵药，碧海青天夜夜心。",
      annotation: "诗人以嫦娥的孤独来表达自己的内心感受，意境深远。",
      tags: ["中秋", "嫦娥", "孤独", "月宫", "深远"],
      festival: "中秋节"
    }
  ],

  // 端午节相关诗词
  dragonBoatFestival: [
    {
      id: 11,
      title: "端午",
      author: "文秀",
      dynasty: "唐",
      content: "节分端午自谁言，万古传闻为屈原。堪笑楚江空渺渺，不能洗得直臣冤。",
      annotation: "诗人感叹屈原的忠贞不渝，表达了对这位爱国诗人的敬仰之情。",
      tags: ["端午", "屈原", "忠贞", "爱国", "楚江"],
      festival: "端午节"
    },
    {
      id: 12,
      title: "端午日",
      author: "殷尧藩",
      dynasty: "唐",
      content: "少年佳节倍多情，老去谁知感慨生。不效艾符趋习俗，但祈蒲酒话升平。鬓丝日日添白头，榴锦年年照眼明。千载贤愚同瞬息，几人湮没几垂名。",
      annotation: "诗人在端午节感叹时光流逝，表达了对和平生活的向往。",
      tags: ["端午", "时光", "和平", "习俗", "感慨"],
      festival: "端午节"
    },
    {
      id: 13,
      title: "端午即事",
      author: "文天祥",
      dynasty: "宋",
      content: "五月五日午，赠我一枝艾。故人不可见，新知万里外。丹心照夙昔，鬓发日已改。我欲从灵均，三湘隔辽海。",
      annotation: "诗人在端午节思念故人，表达了对屈原的敬仰和对国家的忠诚。",
      tags: ["端午", "屈原", "忠诚", "思念", "爱国"],
      festival: "端午节"
    },
    {
      id: 14,
      title: "和端午",
      author: "张耒",
      dynasty: "宋",
      content: "竞渡深悲千载冤，忠魂一去讵能还。国亡身殒今何有，只留离骚在世间。",
      annotation: "诗人感叹屈原的悲剧命运，但赞扬他的精神永存人间。",
      tags: ["端午", "屈原", "忠魂", "离骚", "精神"],
      festival: "端午节"
    },
    {
      id: 15,
      title: "端午三首",
      author: "赵蕃",
      dynasty: "宋",
      content: "谩说投诗赠汨罗，身今且乐奈渠何。尝闻求福木居士，试向艾人成祝呵。忠言不用竟沉死，留得文章星斗罗。何意更觞昌歜酒，为君击节一长歌。年年端午风兼雨，似为屈原陈昔冤。我欲于谁论许事，舍南舍北鹁鸠喧。",
      annotation: "诗人通过三首诗表达了对屈原的敬仰和对端午习俗的描写。",
      tags: ["端午", "屈原", "习俗", "敬仰", "文章"],
      festival: "端午节"
    },
    {
      id: 33,
      title: "乙卯重五诗",
      author: "陆游",
      dynasty: "宋",
      content: "重五山村好，榴花忽已繁。粽包分两髻，艾束著危冠。旧俗方储药，羸躯亦点丹。日斜吾事毕，一笑向杯盘。",
      annotation: "诗人描写端午节的乡村景象，展现了节日的传统习俗和温馨氛围。",
      tags: ["端午", "乡村", "习俗", "粽子", "艾草"],
      festival: "端午节"
    },
    {
      id: 34,
      title: "竞渡歌",
      author: "张建封",
      dynasty: "唐",
      content: "五月五日天晴明，杨花绕江啼晓莺。使君未出郡斋外，江上早闻齐和声。使君出时皆有准，马前已被红旗引。两岸罗衣扑鼻香，银钗照日如霜刃。鼓声三下红旗开，两龙跃出浮水来。棹影斡波飞万剑，鼓声劈浪鸣千雷。鼓声渐急标将近，两龙望标目如瞬。坡上人呼霹雳惊，竿头彩挂虹霓晕。前船抢水已得标，后船失势空挥挠。",
      annotation: "诗人生动地描写了端午节赛龙舟的热烈场面，充满了动感和激情。",
      tags: ["端午", "赛龙舟", "热烈", "竞技", "激情"],
      festival: "端午节"
    },
    {
      id: 35,
      title: "午日处州禁竞渡",
      author: "汤显祖",
      dynasty: "明",
      content: "独写菖蒲竹叶杯，蓬城芳草踏初回。情知不向瓯江死，舟楫何劳吊屈来。",
      annotation: "诗人对端午节禁止赛龙舟的决定有所感慨，表达了对传统文化的关注。",
      tags: ["端午", "禁令", "传统", "文化", "感慨"],
      festival: "端午节"
    }
  ],

  // 重阳节相关诗词
  doubleNinthFestival: [
    {
      id: 16,
      title: "九月九日忆山东兄弟",
      author: "王维",
      dynasty: "唐",
      content: "独在异乡为异客，每逢佳节倍思亲。遥知兄弟登高处，遍插茱萸少一人。",
      annotation: "诗人在重阳节思念远方的兄弟，表达了对亲人的深深思念。",
      tags: ["重阳", "思亲", "兄弟", "茱萸", "异乡"],
      festival: "重阳节"
    },
    {
      id: 17,
      title: "醉花阴·薄雾浓云愁永昼",
      author: "李清照",
      dynasty: "宋",
      content: "薄雾浓云愁永昼，瑞脑销金兽。佳节又重阳，玉枕纱厨，半夜凉初透。东篱把酒黄昏后，有暗香盈袖。莫道不销魂，帘卷西风，人比黄花瘦。",
      annotation: "词人在重阳节思念丈夫，表达了对爱情的深深思念和孤独感。",
      tags: ["重阳", "思念", "爱情", "孤独", "黄花"],
      festival: "重阳节"
    },
    {
      id: 18,
      title: "行军九日思长安故园",
      author: "岑参",
      dynasty: "唐",
      content: "强欲登高去，无人送酒来。遥怜故园菊，应傍战场开。",
      annotation: "诗人在重阳节思念故乡，感叹战争的残酷和对和平的向往。",
      tags: ["重阳", "思乡", "战争", "和平", "菊花"],
      festival: "重阳节"
    },
    {
      id: 19,
      title: "九日齐山登高",
      author: "杜牧",
      dynasty: "唐",
      content: "江涵秋影雁初飞，与客携壶上翠微。尘世难逢开口笑，菊花须插满头归。但将酩酊酬佳节，不用登临恨落晖。古往今来只如此，牛山何必独沾衣。",
      annotation: "诗人在重阳节登高望远，表达了对人生的感悟和对节日的珍惜。",
      tags: ["重阳", "登高", "菊花", "人生", "感悟"],
      festival: "重阳节"
    },
    {
      id: 20,
      title: "重阳席上赋白菊",
      author: "白居易",
      dynasty: "唐",
      content: "满园花菊郁金黄，中有孤丛色似霜。还似今朝歌酒席，白头翁入少年场。",
      annotation: "诗人在重阳节观赏菊花，感叹时光流逝，表达了对青春的怀念。",
      tags: ["重阳", "菊花", "时光", "青春", "怀念"],
      festival: "重阳节"
    },
    {
      id: 36,
      title: "过故人庄",
      author: "孟浩然",
      dynasty: "唐",
      content: "故人具鸡黍，邀我至田家。绿树村边合，青山郭外斜。开轩面场圃，把酒话桑麻。待到重阳日，还来就菊花。",
      annotation: "诗人描写了与朋友的农家聚会，约定重阳节再来赏菊，充满了田园情趣。",
      tags: ["重阳", "菊花", "田园", "友情", "聚会"],
      festival: "重阳节"
    },
    {
      id: 37,
      title: "九日蓝田崔氏庄",
      author: "杜甫",
      dynasty: "唐",
      content: "老去悲秋强自宽，兴来今日尽君欢。羞将短发还吹帽，笑倩旁人为正冠。蓝水远从千涧落，玉山高并两峰寒。明年此会知谁健？醉把茱萸仔细看。",
      annotation: "诗人在重阳节感叹时光流逝，但仍要强颜欢笑，表达了对生命的珍惜。",
      tags: ["重阳", "感叹", "时光", "珍惜", "茱萸"],
      festival: "重阳节"
    },
    {
      id: 38,
      title: "九月十日即事",
      author: "李白",
      dynasty: "唐",
      content: "昨日登高罢，今朝更举觞。菊花何太苦，遭此两重阳。",
      annotation: "诗人以幽默的口吻说菊花遭遇了两个重阳节，充满了诗意和趣味。",
      tags: ["重阳", "菊花", "幽默", "诗意", "趣味"],
      festival: "重阳节"
    }
  ],

  // 元宵节相关诗词
  lanternFestival: [
    {
      id: 21,
      title: "生查子·元夕",
      author: "欧阳修",
      dynasty: "宋",
      content: "去年元夜时，花市灯如昼。月上柳梢头，人约黄昏后。今年元夜时，月与灯依旧。不见去年人，泪湿春衫袖。",
      annotation: "词人在元宵节思念去年的恋人，表达了对爱情的深深思念。",
      tags: ["元宵", "爱情", "思念", "花灯", "月亮"],
      festival: "元宵节"
    },
    {
      id: 22,
      title: "青玉案·元夕",
      author: "辛弃疾",
      dynasty: "宋",
      content: "东风夜放花千树，更吹落、星如雨。宝马雕车香满路。凤箫声动，玉壶光转，一夜鱼龙舞。蛾儿雪柳黄金缕，笑语盈盈暗香去。众里寻他千百度，蓦然回首，那人却在，灯火阑珊处。",
      annotation: "词人描写元宵节的繁华景象，表达了对美好爱情的向往。",
      tags: ["元宵", "花灯", "爱情", "繁华", "美好"],
      festival: "元宵节"
    },
    {
      id: 23,
      title: "正月十五夜",
      author: "苏味道",
      dynasty: "唐",
      content: "火树银花合，星桥铁锁开。暗尘随马去，明月逐人来。游伎皆秾李，行歌尽落梅。金吾不禁夜，玉漏莫相催。",
      annotation: "诗人描写元宵节的夜景，展现了节日的热闹和繁华。",
      tags: ["元宵", "夜景", "繁华", "热闹", "花灯"],
      festival: "元宵节"
    },
    {
      id: 24,
      title: "上元夜",
      author: "崔液",
      dynasty: "唐",
      content: "玉漏银壶且莫催，铁关金锁彻明开。谁家见月能闲坐，何处闻灯不看来。",
      annotation: "诗人描写元宵节的夜景，表达了对节日热闹氛围的喜爱。",
      tags: ["元宵", "夜景", "月亮", "花灯", "热闹"],
      festival: "元宵节"
    },
    {
      id: 25,
      title: "十五夜观灯",
      author: "卢照邻",
      dynasty: "唐",
      content: "锦里开芳宴，兰缸艳早年。缛彩遥分地，繁光远缀天。接汉疑星落，依楼似月悬。别有千金笑，来映九枝前。",
      annotation: "诗人描写元宵节的花灯盛会，展现了节日的美丽和喜庆。",
      tags: ["元宵", "花灯", "喜庆", "美丽", "盛会"],
      festival: "元宵节"
    },
    {
      id: 39,
      title: "元夕于通衢建灯夜升南楼",
      author: "隋炀帝",
      dynasty: "隋",
      content: "法轮天上转，梵声天上来。灯树千光照，花焰七枝开。月影疑流水，春风含夜梅。燔动黄金地，钟发琉璃台。",
      annotation: "诗人描写元宵节的灯会盛景，展现了节日的华丽和庄严。",
      tags: ["元宵", "灯会", "华丽", "庄严", "盛景"],
      festival: "元宵节"
    },
    {
      id: 40,
      title: "观灯乐行",
      author: "李商隐",
      dynasty: "唐",
      content: "月色灯山满帝都，香车宝盖隘通衢。身闲不睹中兴盛，羞逐乡人赛紫姑。",
      annotation: "诗人描写元宵节的繁华景象，但也表达了一种超然的心境。",
      tags: ["元宵", "繁华", "月色", "超然", "心境"],
      festival: "元宵节"
    },
    {
      id: 41,
      title: "汴京元夕",
      author: "李清照",
      dynasty: "宋",
      content: "中州盛日，闺门多暇，记得偏重三五。铺翠冠儿，捻金雪柳，簇带争济楚。如今憔悴，风鬟霜鬓，怕见夜间出去。不如向、帘儿底下，听人笑语。",
      annotation: "词人回忆往昔元宵节的美好时光，对比现在的憔悴，充满了感慨。",
      tags: ["元宵", "回忆", "美好", "憔悴", "感慨"],
      festival: "元宵节"
    }
  ],

  // 清明节相关诗词
  qingmingFestival: [
    {
      id: 42,
      title: "清明",
      author: "杜牧",
      dynasty: "唐",
      content: "清明时节雨纷纷，路上行人欲断魂。借问酒家何处有？牧童遥指杏花村。",
      annotation: "这是最著名的清明诗，描写了清明时节的凄美景象和人们的心情。",
      tags: ["清明", "雨", "断魂", "酒家", "杏花"],
      festival: "清明节"
    },
    {
      id: 43,
      title: "寒食",
      author: "韩翃",
      dynasty: "唐",
      content: "春城无处不飞花，寒食东风御柳斜。日暮汉宫传蜡烛，轻烟散入五侯家。",
      annotation: "诗人描写寒食节的景象，展现了春日的美丽和宫廷的奢华。",
      tags: ["清明", "寒食", "飞花", "东风", "蜡烛"],
      festival: "清明节"
    },
    {
      id: 44,
      title: "清明夜",
      author: "白居易",
      dynasty: "唐",
      content: "好风胧月清明夜，碧砌红轩刺史家。独绕回廊行复歇，遥听弦管暗看花。",
      annotation: "诗人描写清明夜的优美景色，展现了春夜的宁静和美丽。",
      tags: ["清明", "夜", "好风", "月", "花"],
      festival: "清明节"
    },
    {
      id: 45,
      title: "途中寒食",
      author: "宋之问",
      dynasty: "唐",
      content: "马上逢寒食，途中属暮春。可怜江浦望，不见洛桥人。北极怀明主，南溟作逐臣。故园肠断处，日夜柳条新。",
      annotation: "诗人在途中遇到寒食节，思念故乡和君主，表达了深深的思念之情。",
      tags: ["清明", "寒食", "途中", "思念", "故园"],
      festival: "清明节"
    }
  ]
};

// 节日信息配置
export const festivalConfig = {
  springFestival: {
    name: "春节",
    color: "#d32f2f",
    bgColor: "#ffebee",
    icon: "🏮",
    description: "农历正月初一，中国最重要的传统节日"
  },
  midAutumnFestival: {
    name: "中秋节",
    color: "#f57c00",
    bgColor: "#fff3e0",
    icon: "🌕",
    description: "农历八月十五，象征团圆的中秋佳节"
  },
  dragonBoatFestival: {
    name: "端午节",
    color: "#388e3c",
    bgColor: "#e8f5e8",
    icon: "🐉",
    description: "农历五月初五，纪念屈原的传统节日"
  },
  doubleNinthFestival: {
    name: "重阳节",
    color: "#7b1fa2",
    bgColor: "#f3e5f5",
    icon: "🌼",
    description: "农历九月初九，敬老爱老的传统节日"
  },
  lanternFestival: {
    name: "元宵节",
    color: "#1976d2",
    bgColor: "#e3f2fd",
    icon: "🏮",
    description: "农历正月十五，花灯满街的元宵佳节"
  },
  qingmingFestival: {
    name: "清明节",
    color: "#4caf50",
    bgColor: "#e8f5e8",
    icon: "🌿",
    description: "农历三月初，踏青祭祖的传统节日"
  }
};

// 获取当前节日
export function getCurrentFestival() {
  const now = new Date();
  const month = now.getMonth() + 1;
  const date = now.getDate();
  
  // 这里简化处理，实际应用中需要农历转换
  if (month === 1 && date >= 20) return "springFestival";
  if (month === 9 && date >= 15 && date <= 25) return "midAutumnFestival";
  if (month === 6 && date >= 1 && date <= 15) return "dragonBoatFestival";
  if (month === 10 && date >= 1 && date <= 15) return "doubleNinthFestival";
  if (month === 2 && date >= 10 && date <= 20) return "lanternFestival";
  if (month === 4 && date >= 1 && date <= 10) return "qingmingFestival";
  
  return null;
}

// 根据关键词搜索诗词
export function searchPoemsByKeyword(keyword) {
  const allPoems = [];
  Object.values(poemsDatabase).forEach(festivalPoems => {
    allPoems.push(...festivalPoems);
  });
  
  return allPoems.filter(poem => 
    poem.title.includes(keyword) ||
    poem.author.includes(keyword) ||
    poem.content.includes(keyword) ||
    poem.tags.some(tag => tag.includes(keyword))
  );
}

// 根据节日获取诗词
export function getPoemsByFestival(festival) {
  return poemsDatabase[festival] || [];
}

// 获取所有诗词
export function getAllPoems() {
  const allPoems = [];
  Object.values(poemsDatabase).forEach(festivalPoems => {
    allPoems.push(...festivalPoems);
  });
  return allPoems;
} 